#coding=utf-8
import logging
import os

# 数据库信息
CCMSDB = dict(host='127.0.0.1',user='root',passwd='123456',db='ccms',charset='utf8',port=3306)

# 程序版本信息
__VERSION__ = 'CCMS V2.0.0'




# 邮件通知配置
to_email = ['dengzhanguo@guoling.com','zhuhao@guoling.com','gaojinya@guoling.com']
mail_host = u"mail.guoling.com"       
user_name = u"no-reply@guoling.com"   
password = "keepc.com"


#redis配置
REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379
REDIS_DB = 0
REDIS_PWD = ''

#存储到redis数据名称的前缀定义(名称加上任务的id)
CFG_HASH_NAME = 'task_cfg' #任务参数
PRE_EXEC_LIST_NAME = 'task_exec_'
PRE_CALL_HASH_NAME = 'task_call_'
FINISH_HASH_NAME = 'task_finish_'


#cbgw的每秒接收的值
SEND_CBGW_PER = 300
PROCESS__PER = 300
# IP认证通过后可访问comeback接口

# 运行日志位置
__LOG_FILE='./log/run.log'
logger = logging.getLogger()

def initLog():
    __DIR__ = "./log"
    if os.path.isdir(__DIR__) == False:
        os.makedirs(__DIR__) 
    hdlr = logging.handlers.TimedRotatingFileHandler(__LOG_FILE, when='midnight', backupCount=30)
    formatter = logging.Formatter("[%(asctime)s]: %(module)s %(message)s ")
    hdlr.setFormatter(formatter)
    logger.addHandler(hdlr)
    logger.setLevel(logging.DEBUG)
    logger.info("initialization log handler success! FILE=[%s]"%__LOG_FILE)
    
    
    
if __name__=='__main__':
    print 'main'
